package com.handler.inbound;

import com.to.FileReq;
import com.to.MetaInfo;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;

import java.io.FileOutputStream;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;

public class WriterQueue extends SimpleChannelInboundHandler<FileReq> {

    public final BlockingQueue<FileReq> FILE_REQS ;

    public WriterQueue(BlockingQueue<FileReq> fileReqs) {

        FILE_REQS = fileReqs;
    }

    @Override
    protected void channelRead0(ChannelHandlerContext ctx, FileReq fileReq) throws Exception {


        FILE_REQS.add(fileReq);

    }
}
